<template>
  <div class="pollution-source-popup">
    <div class="popup-header">
      <h3>{{ featureData.name || '排污口' }}</h3>
      <span class="close-btn" @click="closePopup">×</span>
    </div>
    <div class="popup-body">
      <el-tabs v-model="activeName">
        <el-tab-pane label="基本信息" name="first">

          <div class="pollution-info">
            <div class="info-item">
              <label>行政区划:</label>
              <span>{{ featureData.county || '--' }}</span>
            </div>
            <div class="info-item">
              <label>河流名称:</label>
              <span>{{ featureData.lakename || '--' }}</span>
            </div>
            <div class="info-item">
              <label>状态:</label>
              <span>{{ featureData.state && this.stateMap ? (this.stateMap[featureData.state]) : '--' }}</span>
            </div>
            <div class="info-item">
              <label>详细地址:</label>
              <span>{{ featureData.address || '--' }}</span>
            </div>
            <div class="info-item">
              <label>一级水功能区名称:</label>
              <span>{{ featureData.onewatername || '--' }}</span>
            </div>
            <div class="info-item">
              <label>二级水功能区名称:</label>
              <span>{{ featureData.twowatername || '--' }}</span>
            </div>
            <div class="info-item">
              <label>二级水功能区名称:</label>
              <span>{{ featureData.twowatername || '--' }}</span>
            </div>
            <div class="info-item">
              <label>入河排污口类型:</label>
              <span>{{ featureData.outfalltype && this.outfalltypeMap ? (this.outfalltypeMap[featureData.outfalltype]) :
                '--' }}</span>
            </div>
            <div class="info-item">
              <label>入河方式:</label>
              <span>{{ featureData.inrivertype || '--' }}</span>
            </div>

            <div class="info-item">
              <label>排放方式:</label>
              <span>{{ featureData.outtype && this.outtypeMap ? (this.outtypeMap[featureData.outtype]) : '--' }}</span>

            </div>

            <div class="info-item">
              <label>批复文号:</label>
              <span>{{ featureData.wh || '--' }}</span>

            </div>
            <div class="info-item">
              <label>执行标准/排放标准:</label>
              <span>{{ featureData.execstandard || '--' }}</span>

            </div>
            <div class="info-item">
              <label>批复（设置）要求:</label>
              <span>{{ featureData.reqapply || '--' }}</span>

            </div>
            <div class="info-item">
              <label>排水量（万吨/年）:</label>
              <span>{{ featureData.displacements || '--' }}</span>

            </div>
            <div class="info-item">
              <label>排污口一级分类名称:</label>
              <span>{{ featureData.outfallfirstclassify || '--' }}</span>

            </div>
            <div class="info-item">
              <label>排污口二级分类:</label>
              <span>{{ featureData.outfallsecondclassify || '--' }}</span>

            </div>
            <div class="info-item">
              <label>排污口三级分类:</label>
              <span>{{ featureData.outfallthirdclassify || '--' }}</span>

            </div>
            <div class="info-item">
              <label>口门形态:</label>

              <span>{{ featureData.mouthdoor && this.mouthdoormap ? (this.mouthdoormap[featureData.mouthdoor]) : '--'
              }}</span>

            </div>


          </div>
        </el-tab-pane>
        <el-tab-pane label="视频" name="second">
          <video class="black-video-placeholder" controls="false"></video>
        </el-tab-pane>
      </el-tabs>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Rehepaiwukou',
  data: function () {
    return {
      activeName: 'first',
      stateMap: {
        '1': '启用',
        '0': '停用'
      },
      outtypeMap: {
        '01': '连续排放',
        '02': '停间歇排放用',
        '03': '其他',
      },

      outfalltypeMap: {
        '186': '入河排污口',
        '187': '入海排污口'

      },
      mouthdoormap: {
        '01': '明渠',
        '02': '管道',
        '03': '泵站',
        '04': '涵闸',
        '05': '闸泵联用',
        '06': '箱涵',
        '07': '隧洞',
        '08': '潜没',
        '09': '其他'
      }


    };
  },
  props: {
    featureData: {
      type: Object,
      default: () => ({})
    }
  },

  methods: {
    closePopup() {
      this.$emit('close');
    }
  }
};
</script>

<style scoped>
.pollution-source-popup {
  min-width: 300px;
  max-width: 450px;
}

.popup-header {
  padding: 10px 16px;
  border-bottom: 1px solid #ebeef5;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.popup-header h3 {
  margin: 0;
  font-size: 16px;
  color: #303133;
}

.close-btn {
  cursor: pointer;
  font-size: 20px;
  color: #909399;
}

.close-btn:hover {
  color: #409eff;
}

.popup-body {
  padding: 5px 16px;
}

.info-item {
  display: flex;
  margin-bottom: 10px;
  font-size: 14px;
}

.info-item:last-child {
  margin-bottom: 0;
}

.info-item label {
  width: 120px;
  color: #606266;
  font-weight: 500;
}

.info-item span {
  flex: 1;
  color: #303133;
}

.black-video-placeholder {
  background-color: #000;
  width: 500px;
  height: 300px;
  border-radius: 4px;
  object-fit: cover;
}
</style>